<?php
$head = APP_PATH.'app/views/head.html';
require_once($head);
?>
<body>
<nav>
    <?php
    //echo $this->tag->linkTo("Clan/index", "返回");//框架内路由
    ?>
</nav>
<div>
    <?php echo $this->tag->form(['clan/crtgen','id'=>'crt_center']) ?>
	<p>
		<label for="name">家族名称</label>
		<?php
			$isEdit = false;
			if(isset($_GET['mode']) && isset($_GET['genno'])){
				$objCt = Center::findFirst('gen_no="'.$_GET['genno'].'"');
				echo $this->tag->textField(array(
					"gen_title",
					"value" => $objCt->gen_title
				)); 
				echo $this->tag->hiddenField(array(
					"gen_no",
					"value" => $objCt->gen_no
				));
				$isEdit = true;
			}
			else echo $this->tag->textField(array(
				"gen_title",
				"value" => $objCt->gen_no
			)); 
		?>
	</p>
	<p>
		<label for="name">家族说明</label><br>
		<?php
			if($isEdit){
				echo $this->tag->textArea(array(
					"gen_desc",
					"value" => $objCt->gen_desc
				)); 
			}
			else echo $this->tag->textArea("gen_desc"); 
		?>
	</p>
	<p>
		<?php echo $this->tag->submitButton("提交") ?>
        <br>
        <span id="form_tip"></span>
	</p>
</form>
</diV>
</body>
</html>